import { Navigate, RouteObject } from "react-router-dom"
import { Issue } from "../pages/issue/index"
import { Book } from "../pages/books"
import { QA } from "../pages/qa"
import { NotFound } from "../pages/notFound"
import { SearchPage } from "../pages/search"
import { IssueDetail } from "../pages/IssueDetail"


export const routerConfig: RouteObject[] = [
  {
    path: "/issues/:id",
    element: <IssueDetail></IssueDetail>,
  },
  {
    path: "/issues",
    element: <Issue></Issue>,
  },
  {
    path: "/",
    element: <Navigate to="/issues"></Navigate>,
  },
  {
    path: "/books",
    element: <Book></Book>,
  },
  {
    path: "/qa",
    element: <QA></QA>,
  },
  {
    path: "/search",
    element: <SearchPage></SearchPage>,
  },
  {
    path: "*",
    element: <NotFound></NotFound>,
  },
]

// createRouter({history, routes: RouteRow[]})
